﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace WpfLearn
{
    public class CustomTextBox : TextBox
    {
        public bool HasText => (bool)GetValue(HasTextProperty);
        public static readonly DependencyProperty HasTextProperty;
        public static readonly DependencyPropertyKey HasTextPropertyKey = DependencyProperty.RegisterReadOnly(
            "HasText",
            typeof(bool),
            typeof(CustomTextBox),
            new PropertyMetadata(true));

        static CustomTextBox()
        {
            HasTextProperty = HasTextPropertyKey.DependencyProperty;
        }

        public CustomTextBox()
        {
            
        }
    }
}
